/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.games.epkb.entityClasses;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author plebani
 */
@Embeddable
public class ConsequentPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "Id_Rule")
    private String idRule;
    @Basic(optional = false)
    @Column(name = "Id_GPI_KPI")
    private String idGPIKPI;

    public ConsequentPK() {
    }

    public ConsequentPK(String idRule, String idGPIKPI) {
        this.idRule = idRule;
        this.idGPIKPI = idGPIKPI;
    }

    public String getIdRule() {
        return idRule;
    }

    public void setIdRule(String idRule) {
        this.idRule = idRule;
    }

    public String getIdGPIKPI() {
        return idGPIKPI;
    }

    public void setIdGPIKPI(String idGPIKPI) {
        this.idGPIKPI = idGPIKPI;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRule != null ? idRule.hashCode() : 0);
        hash += (idGPIKPI != null ? idGPIKPI.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConsequentPK)) {
            return false;
        }
        ConsequentPK other = (ConsequentPK) object;
        if ((this.idRule == null && other.idRule != null) || (this.idRule != null && !this.idRule.equals(other.idRule))) {
            return false;
        }
        if ((this.idGPIKPI == null && other.idGPIKPI != null) || (this.idGPIKPI != null && !this.idGPIKPI.equals(other.idGPIKPI))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "it.polimi.games.epkb.entityClasses.ConsequentPK[ idRule=" + idRule + ", idGPIKPI=" + idGPIKPI + " ]";
    }
    
}
